package com.bwie.utils;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;

import java.io.Serializable;

/**
 * @author LiuWei Chen
 * @version 1.0
 * @description: TODO
 * @date 2025/6/20 11:01
 */
public class TokenUtils implements Serializable {
    public static Integer tokenUtils(String token){
        Claims body = Jwts.parser().setSigningKey("123456").parseClaimsJws(token).getBody();
        return body.get("userId", Integer.class);
    }
    public static String tokenUtilsGetName(String token){
        Claims body = Jwts.parser().setSigningKey("123456").parseClaimsJws(token).getBody();
        return body.get("userName", String.class);
    }
}
